package javaBase.chapter02;

//function函数    method方法
//手机类（）
public class phone {
    //手机的属性
    private String Brand; //定义私有变量  phone.Brand
    private double Size;
    private double Price;
    private String Config ;

    public String getBrand() {
        return Brand;
    }

    public void setBrand(String brand) {
        Brand = brand;
    }

    public double getSize() {
        return Size;
    }

    public void setSize(double size) {
        Size = size;
    }

    public double getPrice() {
        return Price;
    }

    public void setPrice(double price) {
        Price = price;
    }

    public String getConfig() {
        return Config;
    }

    public void setConfig(String config) {
        Config = config;
    }

    @Override
    public String toString() {
        return "phone{" +
                "品牌型号='" + Brand + '\'' +
                ", 尺寸=" + Size +
                ", 价格=" + Price +
                ", 配置='" + Config + '\'' +
                '}';
    }

    public void printMsg(){
        System.out.println("品牌型号：" + Brand);
        System.out.println("尺寸：" + this.Size);// phone.Size
        System.out.println("价格：" + Price);
        System.out.println("配置：" + Config);
    }

}
